package cn.tedu;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Scanner;

public class Demo07 {
    public static void main(String[] args) throws SQLException {
        try (Connection conn = DBUtils.getConn()) {
            Statement s=conn.createStatement();
            ResultSet rs=s.executeQuery("select * from hero");
            while(rs.next()){
                String name=rs.getString(1);
                System.out.println(name);
            }
        }catch (SQLException throwables){
            throwables.printStackTrace();
        }
        System.out.println("执行完毕");
    }
}
